﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace XMM.Dialoges.Library
{
    /// <summary>
    /// Interaktionslogik für CastEditor.xaml
    /// </summary>
    public partial class CastEditor : Window
    {
        public string Cast { get; set; }

        private Controls.Library.Holster_Cast ParentCastHolster;

        public CastEditor(Controls.Library.Holster_Cast ctlParentCastHolster, string sCast)
        {
            InitializeComponent();

            Cast = sCast;
            ParentCastHolster = ctlParentCastHolster;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            txtCast.Text = Cast;
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ParentCastHolster.setCast(txtCast.Text);
            ParentCastHolster.setStatusImage(true);
            Close();
        }
    }
}
